package imse.team0.orders;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * @author Eugen, 4/27/12 8:20 PM
 */
public class Order implements Serializable {
    public String orderid;
    public String clientID;
    public String receiptTime;

    public List<OrderItem> items = new ArrayList<OrderItem>();

    public Order() {
    }

    public Order(String _orderid, String _clientID, String _time) {
        orderid = _orderid;
        clientID = _clientID;
        receiptTime = _time;
    }

    public void addItem(OrderItem item) {
        items.add(item);
    }

    public static class OrderItem implements Serializable {
        public String itemId;
        public int quantity;

        public OrderItem(){

        }

        public OrderItem(String id, int qty) {
            itemId = id;
            quantity = qty;
        }
    }

}
